﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EACancelled.aspx.cs" Inherits="StreetSmartAdmin.EACancelled" %>
<%@ Register TagPrefix="CustUserCtrl" TagName="Header" Src="Header.ascx" %>
<%@ Register TagPrefix="CustUserCtrl" TagName="Footer" Src="Footer.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<script language="javascript" type="text/javascript" src="WdatePicker.js"></script>
<head runat="server">
    <title>Street Smart Energy Admin</title>
    <link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
    <form id="form1" runat="server">
    <CustUserCtrl:Header ID="Header" runat="server"></CustUserCtrl:Header>
    <h1>Energy Australia Cancellation Form</h1>


    <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" 
        onselectedindexchanged="RadioButtonList1_SelectedIndexChanged">
        <asp:ListItem Value="all" Selected="True">Show All Items</asp:ListItem>
        <asp:ListItem Value="add">Add New Item</asp:ListItem>
        <asp:ListItem Value="edit">Search Items</asp:ListItem>
    </asp:RadioButtonList>

    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="2"    >
            <asp:View ID="View1" runat="server">

    <h3>
    <!--
    <asp:Label ID="Label1" runat="server" Text="Conversions Date"></asp:Label>
    <br/>
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Export" />
    -->
    <asp:TextBox ID="TextBox1" runat="server" onclick="WdatePicker()" visible="false"></asp:TextBox>
    <br />
    <br />
    <asp:Label ID="Label2" runat="server" Text="Cancellation Date Range"></asp:Label>   
    <br />
    <asp:Label ID="Label3" runat="server" Text="From"></asp:Label>
    <asp:TextBox ID="TextBox2" runat="server" onclick="WdatePicker()" ></asp:TextBox>
    <asp:Label ID="Label4" runat="server" Text="To"></asp:Label>
    <asp:TextBox ID="TextBox3" runat="server" onclick="WdatePicker()" ></asp:TextBox>
    <asp:Button ID="Button3" runat="server" onclick="Button3_Click" Text="Search" />
    <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Generate" />
    </h3>  
     
    <CustUserCtrl:Footer id="Footer" runat="server"></CustUserCtrl:Footer> 

    <asp:Label ID="Label5" runat="server" Text="Page Size :"></asp:Label>

    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" 
        onselectedindexchanged="DropDownList1_SelectedIndexChanged">
        <asp:ListItem Value="10">10</asp:ListItem>                                   
        <asp:ListItem Value="20">20</asp:ListItem>
        <asp:ListItem Value="50">50</asp:ListItem>
        <asp:ListItem Value="100">100</asp:ListItem>
        <asp:ListItem Value="200">200</asp:ListItem>
        <asp:ListItem Value="500">500</asp:ListItem>
        <asp:ListItem Value="1000">1000</asp:ListItem>
    </asp:DropDownList>

    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" CssClass="mGrid"
            PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" 
            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="VERBAL_ACCEPTANCE_NO" 
            DataSourceID="SqlDataSource2" EnableModelValidation="True">
            <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>


        <Columns>
            
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            
            <asp:TemplateField HeaderText="VERBAL_ACCEPTANCE_NO" 
                SortExpression="VERBAL_ACCEPTANCE_NO">
                <ItemTemplate>
                    <asp:Label ID="Label4" runat="server" 
                        Text='<%# Bind("VERBAL_ACCEPTANCE_NO") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>

                                    <asp:TextBox ID="VERBAL_ACCEPTANCE_NO" runat="server" 
                                        Text='<%# Bind("VERBAL_ACCEPTANCE_NO") %>'></asp:TextBox>

                                    <asp:RequiredFieldValidator ID="VERBAL_ACCEPTANCE_NOVali" runat="server" 
                                            ControlToValidate="VERBAL_ACCEPTANCE_NO" ErrorMessage="*Required Field"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="VERBAL_ACCEPTANCE_NORE" runat="server" 
                                            ErrorMessage="XXXZZZZZZZ9 format(e.g. SSE00000001 XXX:Sale Channel Prefix ZZZZZZZ9:8 digits M1:Optional SME Multi-site No. )" 
                                            ControlToValidate="VERBAL_ACCEPTANCE_NO" ValidationExpression="^[a-zA-Z]{3}\d{8}"></asp:RegularExpressionValidator>



                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="CANCELLATION_DATE" 
                SortExpression="CANCELLATION_DATE">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("CANCELLATION_DATE") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>

                                    <asp:TextBox ID="CANCELLATION_DATE" runat="server" 
                                        onclick="WdatePicker()"
                                        Text='<%# Bind("CANCELLATION_DATE") %>'></asp:TextBox>

                                    <asp:RequiredFieldValidator ID="CANCELLATION_DATEVali" runat="server" 
                                            ControlToValidate="CANCELLATION_DATE" ErrorMessage="*Required Field"></asp:RequiredFieldValidator>
 

                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="CANCELLED_BY" SortExpression="CANCELLED_BY">
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("CANCELLED_BY") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>

                                    <asp:DropDownList ID="SelCANCELLED_BY" runat="server" 
                                        SelectedValue='<%# Bind("CANCELLED_BY") %>'>
                                            <asp:ListItem Value="">Select...</asp:ListItem>
                                            <asp:ListItem>Edia Fisher</asp:ListItem>
                                            <asp:ListItem>Omar Sabbagh</asp:ListItem>
                                            <asp:ListItem>Nicolas</asp:ListItem>
                                            <asp:ListItem>Chuck Robinson</asp:ListItem>     
                                            <asp:ListItem>Kelvin Wiggins</asp:ListItem>
                                            <asp:ListItem>Others</asp:ListItem>
                                        </asp:DropDownList>


                                    <asp:RequiredFieldValidator ID="CANCELLED_BYVali" runat="server" 
                                            ControlToValidate="SelCANCELLED_BY" ErrorMessage="*Required Field"></asp:RequiredFieldValidator>
 


                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="CANCELLED_REASON" 
                SortExpression="CANCELLED_REASON">
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("CANCELLED_REASON") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>

                                        
                                        <asp:DropDownList ID="SelCANCELLED_REASON" runat="server" 
                                            SelectedValue='<%# Bind("CANCELLED_REASON") %>'>
                                            <asp:ListItem Value="">Select...</asp:ListItem>
                                            <asp:ListItem>Contract changed to reflect new offer accepted</asp:ListItem>
                                            <asp:ListItem>Deceased estate</asp:ListItem>
                                            <asp:ListItem>Debt objection</asp:ListItem>
                                            <asp:ListItem>Decided to stay with current retailer</asp:ListItem>
                                            <asp:ListItem>Didn't understand the offer</asp:ListItem>
                                            <asp:ListItem>Dissatisfaction with EA service</asp:ListItem>
                                            <asp:ListItem>Felt coerced into signing contract</asp:ListItem>
                                            <asp:ListItem>Have termination fees with current supplier</asp:ListItem>
                                            <asp:ListItem>Invalid application</asp:ListItem>
                                            <asp:ListItem>Invalid campaign</asp:ListItem>
                                            <asp:ListItem>Moving house</asp:ListItem>
                                            <asp:ListItem>No reason given</asp:ListItem>
                                            <asp:ListItem>Process adjustment</asp:ListItem>
                                            <asp:ListItem>Received better offer from existing retailer</asp:ListItem>
                                            <asp:ListItem>Received better offer from different retailer</asp:ListItem>
                                            <asp:ListItem>Savings offered not enough to bother changing</asp:ListItem>
                                            <asp:ListItem>System cancellation</asp:ListItem>
                                            <asp:ListItem>Wish to honour existing contract</asp:ListItem>
                                        </asp:DropDownList>

                                    <asp:RequiredFieldValidator ID="CANCELLED_REASONVali" runat="server" 
                                            ControlToValidate="SelCANCELLED_REASON" ErrorMessage="*Required Field"></asp:RequiredFieldValidator>
 

                </EditItemTemplate>
            </asp:TemplateField>
            
        </Columns>

<PagerStyle CssClass="pgr"></PagerStyle>
    </asp:GridView>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"       
        
        SelectCommand="SELECT * FROM [tblEACancel] WHERE (([CANCELLATION_DATE] &gt;= @CANCELLATION_DATE) AND ([CANCELLATION_DATE] &lt;= @CANCELLATION_DATE2))" 
        DeleteCommand="DELETE FROM [tblEACancel] WHERE [VERBAL_ACCEPTANCE_NO] = @original_VERBAL_ACCEPTANCE_NO AND (([CANCELLATION_DATE] = @original_CANCELLATION_DATE) OR ([CANCELLATION_DATE] IS NULL AND @original_CANCELLATION_DATE IS NULL)) AND (([CANCELLED_BY] = @original_CANCELLED_BY) OR ([CANCELLED_BY] IS NULL AND @original_CANCELLED_BY IS NULL)) AND (([CANCELLED_REASON] = @original_CANCELLED_REASON) OR ([CANCELLED_REASON] IS NULL AND @original_CANCELLED_REASON IS NULL))" 
        InsertCommand="INSERT INTO [tblEACancel] ([VERBAL_ACCEPTANCE_NO], [CANCELLATION_DATE], [CANCELLED_BY], [CANCELLED_REASON]) VALUES (@VERBAL_ACCEPTANCE_NO, @CANCELLATION_DATE, @CANCELLED_BY, @CANCELLED_REASON)" 
        
        UpdateCommand="UPDATE [tblEACancel] SET [CANCELLATION_DATE] = @CANCELLATION_DATE, [CANCELLED_BY] = @CANCELLED_BY, [CANCELLED_REASON] = @CANCELLED_REASON WHERE [VERBAL_ACCEPTANCE_NO] = @original_VERBAL_ACCEPTANCE_NO AND (([CANCELLATION_DATE] = @original_CANCELLATION_DATE) OR ([CANCELLATION_DATE] IS NULL AND @original_CANCELLATION_DATE IS NULL)) AND (([CANCELLED_BY] = @original_CANCELLED_BY) OR ([CANCELLED_BY] IS NULL AND @original_CANCELLED_BY IS NULL)) AND (([CANCELLED_REASON] = @original_CANCELLED_REASON) OR ([CANCELLED_REASON] IS NULL AND @original_CANCELLED_REASON IS NULL))" 
        ConflictDetection="CompareAllValues" 
        OldValuesParameterFormatString="original_{0}">
        <DeleteParameters>
            <asp:Parameter Name="original_VERBAL_ACCEPTANCE_NO" Type="String" />
            <asp:Parameter Name="original_CANCELLATION_DATE" Type="DateTime" />
            <asp:Parameter Name="original_CANCELLED_BY" Type="String" />
            <asp:Parameter Name="original_CANCELLED_REASON" Type="String" />
        </DeleteParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="TextBox2" Name="CANCELLATION_DATE" 
                PropertyName="Text" Type="DateTime" />
            <asp:ControlParameter ControlID="TextBox3" Name="CANCELLATION_DATE2" 
                PropertyName="Text" Type="DateTime" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="CANCELLATION_DATE" Type="DateTime" />
            <asp:Parameter Name="CANCELLED_BY" Type="String" />
            <asp:Parameter Name="CANCELLED_REASON" Type="String" />
            <asp:Parameter Name="original_VERBAL_ACCEPTANCE_NO" Type="String" />
            <asp:Parameter Name="original_CANCELLATION_DATE" Type="DateTime" />
            <asp:Parameter Name="original_CANCELLED_BY" Type="String" />
            <asp:Parameter Name="original_CANCELLED_REASON" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="VERBAL_ACCEPTANCE_NO" Type="String" />
            <asp:Parameter Name="CANCELLATION_DATE" Type="DateTime" />
            <asp:Parameter Name="CANCELLED_BY" Type="String" />
            <asp:Parameter Name="CANCELLED_REASON" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>"       
        UpdateCommand="UPDATE [tblEACancel] SET [CANCELLATION_DATE] = @CANCELLATION_DATE, [CANCELLED_BY] = @CANCELLED_BY, [CANCELLED_REASON] = @CANCELLED_REASON WHERE [VERBAL_ACCEPTANCE_NO] = @original_VERBAL_ACCEPTANCE_NO AND (([CANCELLATION_DATE] = @original_CANCELLATION_DATE) OR ([CANCELLATION_DATE] IS NULL AND @original_CANCELLATION_DATE IS NULL)) AND (([CANCELLED_BY] = @original_CANCELLED_BY) OR ([CANCELLED_BY] IS NULL AND @original_CANCELLED_BY IS NULL)) AND (([CANCELLED_REASON] = @original_CANCELLED_REASON) OR ([CANCELLED_REASON] IS NULL AND @original_CANCELLED_REASON IS NULL))"  
        DeleteCommand="DELETE FROM [tblEACancel] WHERE [VERBAL_ACCEPTANCE_NO] = @original_VERBAL_ACCEPTANCE_NO AND (([CANCELLATION_DATE] = @original_CANCELLATION_DATE) OR ([CANCELLATION_DATE] IS NULL AND @original_CANCELLATION_DATE IS NULL)) AND (([CANCELLED_BY] = @original_CANCELLED_BY) OR ([CANCELLED_BY] IS NULL AND @original_CANCELLED_BY IS NULL)) AND (([CANCELLED_REASON] = @original_CANCELLED_REASON) OR ([CANCELLED_REASON] IS NULL AND @original_CANCELLED_REASON IS NULL))"
        
                    SelectCommand="SELECT * FROM [tblEACancel] WHERE ([CANCELLATION_DATE] = @CANCELLATION_DATE)" 
                    ConflictDetection="CompareAllValues" 
                    InsertCommand="INSERT INTO [tblEACancel] ([VERBAL_ACCEPTANCE_NO], [CANCELLATION_DATE], [CANCELLED_BY], [CANCELLED_REASON]) VALUES (@VERBAL_ACCEPTANCE_NO, @CANCELLATION_DATE, @CANCELLED_BY, @CANCELLED_REASON)" 
                    OldValuesParameterFormatString="original_{0}">

        <DeleteParameters>
            <asp:Parameter Name="original_VERBAL_ACCEPTANCE_NO" Type="String" />
            <asp:Parameter Name="original_CANCELLATION_DATE" Type="DateTime" />
            <asp:Parameter Name="original_CANCELLED_BY" Type="String" />
            <asp:Parameter Name="original_CANCELLED_REASON" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="VERBAL_ACCEPTANCE_NO" Type="String" />
            <asp:Parameter Name="CANCELLATION_DATE" Type="DateTime" />
            <asp:Parameter Name="CANCELLED_BY" Type="String" />
            <asp:Parameter Name="CANCELLED_REASON" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="TextBox1" Name="CANCELLATION_DATE" 
                PropertyName="Text" Type="DateTime" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="CANCELLATION_DATE" Type="DateTime" />
            <asp:Parameter Name="CANCELLED_BY" Type="String" />
            <asp:Parameter Name="CANCELLED_REASON" Type="String" />
            <asp:Parameter Name="original_VERBAL_ACCEPTANCE_NO" Type="String" />
            <asp:Parameter Name="original_CANCELLATION_DATE" Type="DateTime" />
            <asp:Parameter Name="original_CANCELLED_BY" Type="String" />
            <asp:Parameter Name="original_CANCELLED_REASON" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    
    </asp:View>
    <asp:View ID="View2" runat="server">

    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
        UpdateCommand="UPDATE [tblEACancel] SET [CANCELLATION_DATE] = @CANCELLATION_DATE, [CANCELLED_BY] = @CANCELLED_BY, [CANCELLED_REASON] = @CANCELLED_REASON WHERE [VERBAL_ACCEPTANCE_NO] = @original_VERBAL_ACCEPTANCE_NO AND (([CANCELLATION_DATE] = @original_CANCELLATION_DATE) OR ([CANCELLATION_DATE] IS NULL AND @original_CANCELLATION_DATE IS NULL)) AND (([CANCELLED_BY] = @original_CANCELLED_BY) OR ([CANCELLED_BY] IS NULL AND @original_CANCELLED_BY IS NULL)) AND (([CANCELLED_REASON] = @original_CANCELLED_REASON) OR ([CANCELLED_REASON] IS NULL AND @original_CANCELLED_REASON IS NULL))" 
 
        DeleteCommand="DELETE FROM [tblEACancel] WHERE [VERBAL_ACCEPTANCE_NO] = @original_VERBAL_ACCEPTANCE_NO AND (([CANCELLATION_DATE] = @original_CANCELLATION_DATE) OR ([CANCELLATION_DATE] IS NULL AND @original_CANCELLATION_DATE IS NULL)) AND (([CANCELLED_BY] = @original_CANCELLED_BY) OR ([CANCELLED_BY] IS NULL AND @original_CANCELLED_BY IS NULL)) AND (([CANCELLED_REASON] = @original_CANCELLED_REASON) OR ([CANCELLED_REASON] IS NULL AND @original_CANCELLED_REASON IS NULL))"
        SelectCommand="SELECT * FROM [tblEACancel]"
        InsertCommand="INSERT INTO [tblEACancel] ([VERBAL_ACCEPTANCE_NO], [CANCELLATION_DATE], [CANCELLED_BY], [CANCELLED_REASON]) VALUES (@VERBAL_ACCEPTANCE_NO, @CANCELLATION_DATE, @CANCELLED_BY, @CANCELLED_REASON)"
        ConflictDetection="CompareAllValues" 
            OldValuesParameterFormatString="original_{0}">


                   <DeleteParameters>
                       <asp:Parameter Name="original_VERBAL_ACCEPTANCE_NO" Type="String" />
                       <asp:Parameter Name="original_CANCELLATION_DATE" Type="DateTime" />
                       <asp:Parameter Name="original_CANCELLED_BY" Type="String" />
                       <asp:Parameter Name="original_CANCELLED_REASON" Type="String" />
                   </DeleteParameters>
                   <InsertParameters>
                       <asp:Parameter Name="VERBAL_ACCEPTANCE_NO" Type="String" />
                       <asp:Parameter Name="CANCELLATION_DATE" Type="DateTime" />
                       <asp:Parameter Name="CANCELLED_BY" Type="String" />
                       <asp:Parameter Name="CANCELLED_REASON" Type="String" />
                   </InsertParameters>
                   <UpdateParameters>
                       <asp:Parameter Name="CANCELLATION_DATE" Type="DateTime" />
                       <asp:Parameter Name="CANCELLED_BY" Type="String" />
                       <asp:Parameter Name="CANCELLED_REASON" Type="String" />
                       <asp:Parameter Name="original_VERBAL_ACCEPTANCE_NO" Type="String" />
                       <asp:Parameter Name="original_CANCELLATION_DATE" Type="DateTime" />
                       <asp:Parameter Name="original_CANCELLED_BY" Type="String" />
                       <asp:Parameter Name="original_CANCELLED_REASON" Type="String" />
                   </UpdateParameters>
    </asp:SqlDataSource>

    <asp:DetailsView ID="DetailsView1" runat="Server" CellPadding="4" ForeColor="#333333"
                        GridLines="None" DataSourceID="SqlDataSource3" 
        AllowPaging="True" AutoGenerateRows="False" AutoGenerateInsertButton="True" 
        DefaultMode="Insert" CssClass="mGrid" DataKeyNames="VERBAL_ACCEPTANCE_NO"
                        PagerStyle-CssClass="pgr" 
        AlternatingRowStyle-CssClass="alt" EnableModelValidation="True">
                        <Fields>
                            
                            <asp:TemplateField HeaderText="Verbal Acceptance Number:" 
                                SortExpression="VERBAL_ACCEPTANCE_NO">
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" 
                                        Text='<%# Bind("VERBAL_ACCEPTANCE_NO") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" 
                                        Text='<%# Bind("VERBAL_ACCEPTANCE_NO") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>


                                    <asp:DropDownList ID="VERBAL_ACCEPTANCE_NO" runat="server" 
                                        DataSourceID="SqlDataSource4" DataTextField="VERBAL_ACCEPTANCE_NO" 
                                        DataValueField="VERBAL_ACCEPTANCE_NO" 
                                        Text='<%# Bind("VERBAL_ACCEPTANCE_NO") %>' AutoPostBack="True">
                                    </asp:DropDownList>
                                    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                        SelectCommand="SELECT DISTINCT [VERBAL_ACCEPTANCE_NO] FROM [tblEA] ORDER BY [VERBAL_ACCEPTANCE_NO]">
                                    </asp:SqlDataSource>

                                    <asp:RequiredFieldValidator ID="VERBAL_ACCEPTANCE_NOVali" runat="server" 
                                            ControlToValidate="VERBAL_ACCEPTANCE_NO" ErrorMessage="*Required Field"></asp:RequiredFieldValidator>


                                    <asp:SqlDataSource ID="SqlDataSource7" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                        SelectCommand="SELECT [FIRST_NAME], [LAST_NAME] FROM [tblEA] WHERE ([VERBAL_ACCEPTANCE_NO] = @VERBAL_ACCEPTANCE_NO)">
                                        <SelectParameters>
                                            <asp:ControlParameter ControlID="VERBAL_ACCEPTANCE_NO" 
                                                Name="VERBAL_ACCEPTANCE_NO" PropertyName="SelectedValue" Type="String" />
                                        </SelectParameters>
                                    </asp:SqlDataSource>
                                    <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource7" 
                                        EnableModelValidation="True">
                                        <EditItemTemplate>
                                            FIRST_NAME:
                                            <asp:TextBox ID="FIRST_NAMETextBox" runat="server" 
                                                Text='<%# Bind("FIRST_NAME") %>' />
                                            <br />
                                            LAST_NAME:
                                            <asp:TextBox ID="LAST_NAMETextBox" runat="server" 
                                                Text='<%# Bind("LAST_NAME") %>' />
                                            <br />
                                            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                                                CommandName="Update" Text="Update" />
                                            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                                                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            FIRST_NAME:
                                            <asp:TextBox ID="FIRST_NAMETextBox" runat="server" 
                                                Text='<%# Bind("FIRST_NAME") %>' />
                                            <br />
                                            LAST_NAME:
                                            <asp:TextBox ID="LAST_NAMETextBox" runat="server" 
                                                Text='<%# Bind("LAST_NAME") %>' />
                                            <br />
                                            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                                                CommandName="Insert" Text="Insert" />
                                            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                                                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            FIRST_NAME:
                                            <asp:Label ID="FIRST_NAMELabel" runat="server" 
                                                Text='<%# Bind("FIRST_NAME") %>' />
                                            <br />
                                            LAST_NAME:
                                            <asp:Label ID="LAST_NAMELabel" runat="server" Text='<%# Bind("LAST_NAME") %>' />
                                            <br />
                                        </ItemTemplate>
                                    </asp:FormView>


                                </InsertItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Cancellation Date:" 
                                SortExpression="CANCELLATION_DATE">
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("CANCELLATION_DATE") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox2" runat="server" 
                                        Text='<%# Bind("CANCELLATION_DATE") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="CANCELLATION_DATE" runat="server" 
                                        onclick="WdatePicker()"
                                        Text='<%# Bind("CANCELLATION_DATE") %>'></asp:TextBox>

                                    <asp:RequiredFieldValidator ID="CANCELLATION_DATEVali" runat="server" 
                                            ControlToValidate="CANCELLATION_DATE" ErrorMessage="*Required Field"></asp:RequiredFieldValidator>
 

                                </InsertItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Cancelled By:" SortExpression="CANCELLED_BY">
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("CANCELLED_BY") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("CANCELLED_BY") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>

                                    <asp:DropDownList ID="SelCANCELLED_BY" runat="server" 
                                        SelectedValue='<%# Bind("CANCELLED_BY") %>'>
                                            <asp:ListItem Value="">Select...</asp:ListItem>
                                            <asp:ListItem>Edia Fisher</asp:ListItem>
                                            <asp:ListItem>Omar Sabbagh</asp:ListItem>
                                            <asp:ListItem>Nicolas</asp:ListItem>
                                            <asp:ListItem>Chuck Robinson</asp:ListItem>     
                                            <asp:ListItem>Kelvin Wiggins</asp:ListItem>
                                            <asp:ListItem>Others</asp:ListItem>
                                        </asp:DropDownList>


                                    <asp:RequiredFieldValidator ID="CANCELLED_BYVali" runat="server" 
                                            ControlToValidate="SelCANCELLED_BY" ErrorMessage="*Required Field"></asp:RequiredFieldValidator>
 
                                
                                </InsertItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Cancelled Reason:" 
                                SortExpression="CANCELLED_REASON">
                                <ItemTemplate>
                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("CANCELLED_REASON") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox4" runat="server" 
                                        Text='<%# Bind("CANCELLED_REASON") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>

                                        
                                        <asp:DropDownList ID="SelCANCELLED_REASON" runat="server" 
                                            SelectedValue='<%# Bind("CANCELLED_REASON") %>'>
                                            <asp:ListItem Value="">Select...</asp:ListItem>
                                            <asp:ListItem>Contract changed to reflect new offer accepted</asp:ListItem>
                                            <asp:ListItem>Deceased estate</asp:ListItem>
                                            <asp:ListItem>Debt objection</asp:ListItem>
                                            <asp:ListItem>Decided to stay with current retailer</asp:ListItem>
                                            <asp:ListItem>Didn't understand the offer</asp:ListItem>
                                            <asp:ListItem>Dissatisfaction with EA service</asp:ListItem>
                                            <asp:ListItem>Felt coerced into signing contract</asp:ListItem>
                                            <asp:ListItem>Have termination fees with current supplier</asp:ListItem>
                                            <asp:ListItem>Invalid application</asp:ListItem>
                                            <asp:ListItem>Invalid campaign</asp:ListItem>
                                            <asp:ListItem>Moving house</asp:ListItem>
                                            <asp:ListItem>No reason given</asp:ListItem>
                                            <asp:ListItem>Process adjustment</asp:ListItem>
                                            <asp:ListItem>Received better offer from existing retailer</asp:ListItem>
                                            <asp:ListItem>Received better offer from different retailer</asp:ListItem>
                                            <asp:ListItem>Savings offered not enough to bother changing</asp:ListItem>
                                            <asp:ListItem>System cancellation</asp:ListItem>
                                            <asp:ListItem>Wish to honour existing contract</asp:ListItem>
                                        </asp:DropDownList>

                                    <asp:RequiredFieldValidator ID="CANCELLED_REASONVali" runat="server" 
                                            ControlToValidate="SelCANCELLED_REASON" ErrorMessage="*Required Field"></asp:RequiredFieldValidator>
 
                                </InsertItemTemplate>
                            </asp:TemplateField>
                            
                        </Fields>
                        <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>

                    <PagerStyle CssClass="pgr"></PagerStyle>
                    </asp:DetailsView>


     </asp:View>
     <asp:View ID="View3" runat="server">

         <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
             ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
             SelectCommand="SELECT * FROM [tblEACancel]" 
             DeleteCommand="DELETE FROM [tblEACancel] WHERE [VERBAL_ACCEPTANCE_NO] = @VERBAL_ACCEPTANCE_NO" 
             InsertCommand="INSERT INTO [tblEACancel] ([VERBAL_ACCEPTANCE_NO], [CANCELLATION_DATE], [CANCELLED_BY], [CANCELLED_REASON]) VALUES (@VERBAL_ACCEPTANCE_NO, @CANCELLATION_DATE, @CANCELLED_BY, @CANCELLED_REASON)" 
             UpdateCommand="UPDATE [tblEACancel] SET [CANCELLATION_DATE] = @CANCELLATION_DATE, [CANCELLED_BY] = @CANCELLED_BY, [CANCELLED_REASON] = @CANCELLED_REASON WHERE [VERBAL_ACCEPTANCE_NO] = @VERBAL_ACCEPTANCE_NO">
             <DeleteParameters>
                 <asp:Parameter Name="VERBAL_ACCEPTANCE_NO" Type="String" />
             </DeleteParameters>
             <InsertParameters>
                 <asp:Parameter Name="VERBAL_ACCEPTANCE_NO" Type="String" />
                 <asp:Parameter Name="CANCELLATION_DATE" Type="DateTime" />
                 <asp:Parameter Name="CANCELLED_BY" Type="String" />
                 <asp:Parameter Name="CANCELLED_REASON" Type="String" />
             </InsertParameters>
             <UpdateParameters>
                 <asp:Parameter Name="CANCELLATION_DATE" Type="DateTime" />
                 <asp:Parameter Name="CANCELLED_BY" Type="String" />
                 <asp:Parameter Name="CANCELLED_REASON" Type="String" />
                 <asp:Parameter Name="VERBAL_ACCEPTANCE_NO" Type="String" />
             </UpdateParameters>
         </asp:SqlDataSource>

    <asp:GridView ID="GridView2" runat="server" AllowPaging="True" CssClass="mGrid"
            PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" 
            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="VERBAL_ACCEPTANCE_NO" 
            DataSourceID="SqlDataSource6" EnableModelValidation="True">
            <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>

             <Columns>
                 <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                 <asp:BoundField DataField="VERBAL_ACCEPTANCE_NO" 
                     HeaderText="VERBAL_ACCEPTANCE_NO" ReadOnly="True" 
                     SortExpression="VERBAL_ACCEPTANCE_NO" />
                 <asp:TemplateField HeaderText="CANCELLATION_DATE" 
                     SortExpression="CANCELLATION_DATE">
                     <ItemTemplate>
                         <asp:Label ID="Label1" runat="server" Text='<%# Bind("CANCELLATION_DATE") %>'></asp:Label>
                     </ItemTemplate>
                     <EditItemTemplate>

                         <asp:TextBox ID="CANCELLATION_DATE" runat="server" 
                                        onclick="WdatePicker()"
                                        Text='<%# Bind("CANCELLATION_DATE") %>'></asp:TextBox>

                         <asp:RequiredFieldValidator ID="CANCELLATION_DATEVali" runat="server" 
                                            ControlToValidate="CANCELLATION_DATE" ErrorMessage="*Required Field"></asp:RequiredFieldValidator>
 



                     </EditItemTemplate>
                 </asp:TemplateField>
                 <asp:TemplateField HeaderText="CANCELLED_BY" SortExpression="CANCELLED_BY">
                     <ItemTemplate>
                         <asp:Label ID="Label2" runat="server" Text='<%# Bind("CANCELLED_BY") %>'></asp:Label>
                     </ItemTemplate>
                     <EditItemTemplate>

                         <asp:DropDownList ID="SelCANCELLED_BY" runat="server" 
                                        SelectedValue='<%# Bind("CANCELLED_BY") %>'>
                                            <asp:ListItem Value="">Select...</asp:ListItem>
                                            <asp:ListItem>Edia Fisher</asp:ListItem>
                                            <asp:ListItem>Omar Sabbagh</asp:ListItem>
                                            <asp:ListItem>Nicolas</asp:ListItem>
                                            <asp:ListItem>Chuck Robinson</asp:ListItem>     
                                            <asp:ListItem>Kelvin Wiggins</asp:ListItem>
                                            <asp:ListItem>Others</asp:ListItem>
                                        </asp:DropDownList>


                                    <asp:RequiredFieldValidator ID="CANCELLED_BYVali" runat="server" 
                                            ControlToValidate="SelCANCELLED_BY" ErrorMessage="*Required Field"></asp:RequiredFieldValidator>
 
                     
                     </EditItemTemplate>
                 </asp:TemplateField>
                 <asp:TemplateField HeaderText="CANCELLED_REASON" 
                     SortExpression="CANCELLED_REASON">
                     <ItemTemplate>
                         <asp:Label ID="Label3" runat="server" Text='<%# Bind("CANCELLED_REASON") %>'></asp:Label>
                     </ItemTemplate>
                     <EditItemTemplate>

                                        
                         <asp:DropDownList ID="SelCANCELLED_REASON" runat="server" 
                                            SelectedValue='<%# Bind("CANCELLED_REASON") %>'>
                                            <asp:ListItem Value="">Select...</asp:ListItem>
                                            <asp:ListItem>Contract changed to reflect new offer accepted</asp:ListItem>
                                            <asp:ListItem>Deceased estate</asp:ListItem>
                                            <asp:ListItem>Debt objection</asp:ListItem>
                                            <asp:ListItem>Decided to stay with current retailer</asp:ListItem>
                                            <asp:ListItem>Didn't understand the offer</asp:ListItem>
                                            <asp:ListItem>Dissatisfaction with EA service</asp:ListItem>
                                            <asp:ListItem>Felt coerced into signing contract</asp:ListItem>
                                            <asp:ListItem>Have termination fees with current supplier</asp:ListItem>
                                            <asp:ListItem>Invalid application</asp:ListItem>
                                            <asp:ListItem>Invalid campaign</asp:ListItem>
                                            <asp:ListItem>Moving house</asp:ListItem>
                                            <asp:ListItem>No reason given</asp:ListItem>
                                            <asp:ListItem>Process adjustment</asp:ListItem>
                                            <asp:ListItem>Received better offer from existing retailer</asp:ListItem>
                                            <asp:ListItem>Received better offer from different retailer</asp:ListItem>
                                            <asp:ListItem>Savings offered not enough to bother changing</asp:ListItem>
                                            <asp:ListItem>System cancellation</asp:ListItem>
                                            <asp:ListItem>Wish to honour existing contract</asp:ListItem>
                                        </asp:DropDownList>

                         <asp:RequiredFieldValidator ID="CANCELLED_REASONVali" runat="server" 
                                            ControlToValidate="SelCANCELLED_REASON" ErrorMessage="*Required Field"></asp:RequiredFieldValidator>
 


                     </EditItemTemplate>
                 </asp:TemplateField>
             </Columns>
            <PagerStyle CssClass="pgr" />
         </asp:GridView>
     </asp:View>
     </asp:MultiView>



    </form>

</body>
</html>
